import Vue from 'vue'
import '@/styles/index.scss'
import { Menu, Submenu, MenuItemGroup, Button, MenuItem } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
import Keycloak from 'keycloak-js'
import './styles/reset.scss'
import './styles/fontsize/font.css'

Vue.config.productionTip = false
Vue.component(Menu.name, Menu)
Vue.component(Submenu.name, Submenu)
Vue.component(MenuItemGroup.name, MenuItemGroup)
Vue.component(MenuItem.name, MenuItem)
Vue.component(Button.name, Button)

const initOptions = {
  url: 'http://ww1.hbjrpt.com/auth',
  realm: 'hbjrpt',
  clientId: 'piaoju_hbjrpt_com',
  onLoad: 'check-sso'
}
const keycloak = Keycloak(initOptions)
keycloak.init({ onLoad: initOptions.onLoad }).then(async authenticated => {
  console.log(authenticated)
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
